<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>

<div id="app">
    <!--之前的方法-->
    <!--阻止默认事件.prevet-->
    <<a :href="url" :style="style" @click.prevent>itcast</a>

    <a href="http://www.itcast.cn" onclick="demo1(event)">itcast</a>
</div>
</body>
<script>

    function demo1(event) {
        event.preventDefault()
    }

    new  Vue({
        el:"#app",
        data:{
            url:"http://www.itcast.cn",
            style:"color: red"
        }
    })
</script>
</body>
</html>